<template>
  <div class="dialog">
    <el-form :model="editData">
      <el-form-item label="状态" :label-width="formLabelWidth">
        <el-select v-model="editData.orderStatus" placeholder="请选择该用户的帐户状态">
            <el-option label="未付款" :value="0"></el-option>
            <el-option label="待发货" :value="1"></el-option>
            <el-option label="已发货" :value="2"></el-option>
            <el-option label="已完成" :value="3"></el-option>
            <el-option label="退款中" :value="4"></el-option>
            <el-option label="退款成功" :value="5"></el-option>
            <el-option label="已取消" :value="6"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item>
          <el-checkbox v-model="deliverSMS">发送通知短信</el-checkbox>
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="cancel({type: 'off'})">取 消</el-button>
      <el-button type="primary" @click="cancel({type:'on',data:{}})">确 定</el-button>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    editData: {
      type: Object
    }
  },
  data() {
    return {
      formLabelWidth: "120px",
      deliverSMS: true
    };
  },
  methods: {
    cancel(msg) {
      // debugger
      let type = msg.type;
      switch (type) {
        case "on": {
          this.$emit("upData", {
            ...this.editData,
            deliverSMS: this.deliverSMS
          });
          break;
        }
        case "off": {
          break;
        }
      }
      this.$emit("change", false);
    }
  }
};
</script>

<style lang='scss' scoped>
.dialog {
  .dialog-footer {
    text-align: right;
  }
}
</style>
